﻿Public Class formtes
    Dim xSoal() As String = Split(System.IO.File.ReadAllText("Soal.txt"), vbCrLf)
    Dim xLabelSoal(UBound(xSoal)) As String
    Dim xNomorSoal(UBound(xSoal)) As String
    Dim xJawaban(UBound(xSoal)) As Integer
    Dim xPicture(UBound(xSoal)) As Integer
    Dim xPointer As Integer = 0
    Dim xUrutan As Integer
    Public Property urutan As Integer
        Get
            Return xUrutan
        End Get
        Set(ByVal value As Integer)
            xUrutan = value
        End Set
    End Property
    Public Sub PictureBox2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox2.Click
        If xPointer < 10 Then
            Dim PanelSoal As New Soal
            PanelSoal.Left = 170
            PanelSoal.Top = 68
            PanelSoal.Soal = xLabelSoal(xPointer)
            PanelSoal.refreshSoal(ImageList1.Images(xPointer), ImageList2.Images(xPointer), ImageList3.Images(xPointer), ImageList4.Images(xPointer), ImageList5.Images(xPointer))
            PanelSoal.Jawaban = xJawaban(xPointer)
            Me.Controls.Add(PanelSoal)
            xPointer += 1
        Else
            Label1.Visible = True
        End If
        Dim kelas As New player
        kelas.Nilai = lblSkor.Text
        kelas.skor(lblSkor.Text)
    End Sub

    Private Sub PictureBox3_Click(sender As System.Object, e As System.EventArgs) Handles PictureBox3.Click
        form_intermediate.Show()
        Dim kelas As New player
        kelas.skor(lblSkor.Text)

        Me.Close()

    End Sub

    Public Sub formtes_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Label1.Visible = False
        For i As Integer = 0 To UBound(xSoal)
            Dim xTemp() As String = Split(xSoal(i), ",")
            xLabelSoal(i) = xTemp(0)
            xJawaban(i) = xTemp(1)
            xPicture(i) = i
            xNomorSoal(i) = i
        Next
        xPointer = 0
    End Sub
  
End Class